<template>
  <!-- 节点操作菜单弹窗 - 中间弹出层 -->
  <view class="center-menu-container">
    <!-- 头部标题 -->
    <view class="center-header">jifajflsdjalafsjl</view>
  </view>
</template>

<script>
export default {
  name: "OpaList",
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
    selectedNode: {
      type: Object,
      default: () => ({}),
    },
  },
  emits: ["close", "action"],
  methods: {
    handleClose() {
      this.$emit("close");
    },
    handleAction(actionType) {
      this.$emit("action", {
        type: actionType,
        node: this.selectedNode,
      });
      this.handleClose();
    },
  },
};
</script>

<style scoped>
/* 中间弹出层样式 */
.node-center-popup {
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.center-menu-container {
  background: #fff;
  border-radius: 24rpx;
  width: 600rpx;
  max-width: 90vw;
  box-shadow: 0 8rpx 48rpx rgba(0, 0, 0, 0.15);
  overflow: hidden;
  animation: centerPopupShow 0.3s ease-out;
}

@keyframes centerPopupShow {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.center-header {
  padding: 48rpx 32rpx 32rpx;
  text-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.avatar-wrapper {
  margin-bottom: 24rpx;
}

.center-avatar {
  width: 120rpx;
  height: 120rpx;
  border-radius: 50%;
  border: 4rpx solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.2);
}

.center-avatar-placeholder {
  width: 120rpx;
  height: 120rpx;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  border: 4rpx solid rgba(255, 255, 255, 0.3);
}

.center-name {
  display: block;
  font-size: 36rpx;
  font-weight: 700;
  margin-bottom: 8rpx;
}

.center-subtitle {
  display: block;
  font-size: 28rpx;
  opacity: 0.9;
}

.center-actions {
  padding: 40rpx 32rpx;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24rpx;
  margin-bottom: 40rpx;
}

.action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32rpx 16rpr;
  background: #f8f9fa;
  border-radius: 16rpx;
  transition: all 0.2s ease;
}

.action-item:active {
  transform: scale(0.95);
  background: #e9ecef;
}

.action-icon {
  width: 60rpx;
  height: 60rpx;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16rpx;
}

.action-icon.add-parent {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.action-icon.add-child {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.action-icon.add-spouse {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.action-icon.edit-info {
  background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

.action-label {
  font-size: 24rpx;
  color: #333;
  font-weight: 500;
}

.delete-section {
  border-top: 1rpx solid #eee;
  padding-top: 32rpx;
}

.delete-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28rpx;
  background: #fff5f5;
  border: 1rpx solid #fed7d7;
  border-radius: 16rpx;
  transition: all 0.2s ease;
}

.delete-item:active {
  background: #fed7d7;
  transform: scale(0.98);
}

.delete-icon {
  margin-right: 16rpx;
}

.delete-label {
  font-size: 28rpx;
  color: #ff3b30;
  font-weight: 500;
}

.center-close {
  position: absolute;
  top: 24rpx;
  right: 24rpx;
  width: 48rpx;
  height: 48rpx;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.center-close:active {
  background: rgba(0, 0, 0, 0.2);
}

/* 响应式适配 */
@media screen and (max-width: 480px) {
  .center-menu-container {
    width: 85vw;
  }

  .action-grid {
    grid-template-columns: 1fr;
    gap: 16rpx;
  }

  .action-item {
    flex-direction: row;
    justify-content: flex-start;
    padding: 24rpr;
  }

  .action-icon {
    margin-right: 20rpx;
    margin-bottom: 0;
  }
}
</style>
